// 详情页
/*app.register.controller('detailCtrl',['$scope','$location', '$http','$stateParams','$timeout','$cookies','$filter',
    function ($scope,$location,$http,$stateParams,$timeout,$cookies,$filter) {
        //请求数据
        var postData = $config.urlCode({
            directoryCode : $stateParams.code,
            platformType : $stateParams.type
        })
        $http.post($config.host+'?m=Policy&a=scoreOverview',postData).success(function (json) {
            // console.log(json);
            if(json.errcode==0){
                $scope.jsons = json.data;
                //微信分享
                $config.wxShare({
                    title: '隐私政策透明度测评-'+$scope.jsons.current['platform-name']+' 等级:'+$filter('gradeFilter')($scope.jsons.current['score-total']),
                    cont : '常用网站、APP个人信息保护政策透明度报告重磅发布',
                    url : location.href
                })
            }
        })

        //显示更多评分规则小项
        /!*$scope.showMore = function () {
            var moreData = $config.urlCode({
                directoryCode : $stateParams.code,
                scoreVersion: $scope.jsons.current['detail-version-applied']
            })
            $http.post($config.host+'?m=Policy&a=scoreDetail',moreData).success(function (json) {
                console.log(json);
                if(json.errcode==0){
                    $scope.rules = json.data.data;
                }
            })
        }*!/
}])*/

//评分详细页
app.register.controller('gradedetailCtrl',['$scope','$location', '$http','$stateParams','$timeout','$cookies',
    function ($scope,$location,$http,$stateParams,$timeout,$cookies) {
        $scope.name = $stateParams.name;
        //显示更多评分规则小项
        $scope.showMore = function () {
            var moreData = $config.urlCode({
                /*directoryCode : $stateParams.code,
                scoreVersion: $stateParams.type*/
                evaluate_flag : $scope.name
            })
            $http.post($config.host+'?m=Evaluate&a=ruleList',moreData).success(function (json) {
                console.log(json);
                if(json.errcode==0){
                    $scope.rules = json.data;
                }
            })
        }
        $scope.showMore()
}])